<%@tag language="java" pageEncoding="UTF-8"%>
<%@tag import="fr.inserm.u915.organifooyi.model.OrganiFooyiDao"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" tagdir="/WEB-INF/tags" %>
<%@attribute name="table" required="true" rtexprvalue="true" type="fr.inserm.u915.organifooyi.model.HistoryTable"%>
<c:if test="${not empty table }">
<table class="historyTable">
<thead>
<tr>
	<th>Date</th>
	<th>User</th>
	<c:forEach var="th" items="${table.headers}">
	<th>
		<c:out value="${th}" escapeXml="true"/>
	</th>
	</c:forEach>
</tr>
</thead>
<tbody>
<c:forEach var="row" items="${table.rows}">
<tr>
	<td><c:out value="${row.date}" escapeXml="true"/></td>
	<td><u:user-href user="${row.user}"/></td>
	<c:forEach var="cell" items="${row.cells}">
		<td><c:out value="${cell.value}" escapeXml="true"/>
		<c:if test="${not empty cell.diff and cell.diff ne 0.0}">
			<span>( ${cell.diff } )</span>
		</c:if>
		</td>
	</c:forEach>
</tr>
</c:forEach>
</tbody>
</table>
</c:if>